<template>
	<card-block title="通知公告">
		<template slot="tabs">
			<router-link to="/platform/announcement">
				更多
				<i class="el-icon-arrow-right"></i>
			</router-link>
		</template>
		<template slot="content">
			<div class="system_notice">
				<el-table :data="noticeList" height="100%" :show-header="false">
					<!-- <el-table-column width="36">
						<template slot-scope="{ $index }">
							<span class="index">{{ $index + 1 }}</span>
						</template>
					</el-table-column> -->
					<el-table-column min-width="250">
						<template slot-scope="{ row }">
							<el-link :href="`/#/platform/announcement/${row.id}`" :title="row.title" target="_blank">{{ row.title }}</el-link>
						</template>
					</el-table-column>
					<template slot="empty">
						<el-empty :image-size="100" description="暂无通知公告"></el-empty>
					</template>
				</el-table>
			</div>
		</template>
	</card-block>
</template>

<script>
import cardBlock from './cardBlock';
import { getJournalismPageList } from '@/api/platform/tbSysJournalism';
export default {
	components: { cardBlock },
	data() {
		return {
			noticeList: []
		};
	},
	mounted() {
		this.getNoticeList();
	},
	methods: {
		async getNoticeList() {
			let params = { page: 1, limit: 6, type: 100, del: 1 };
			let result = await getJournalismPageList(params).then((res) => res.data);
			if (result.code === '0') {
				this.noticeList = result.data || [];
			}
		}
	}
};
</script>

<style lang="scss" scoped>
.system_notice::v-deep {
	padding: 0 16px 15px;
	box-sizing: border-box;
	height: 100%;
	.el-table {
		.cell {
			padding: 0;
			line-height: 1;
		}
		&::before {
			content: none;
		}
	}
	.el-table__row {
		&:last-child td {
			padding-bottom: 0;
		}
	}
	.el-table__cell {
		padding: 8px 0;
		border-bottom: none;
	}
	.el-table__row:hover td {
		background: none;
	}
	.el-table__empty-text {
		line-height: 1;
	}
	a.el-link {
		display: inline;
		max-width: 100%;
		line-height: 24px;
		text-decoration: none;
	}
	.el-link--inner {
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}
</style>
